Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

169
Visualizações
Difference between "PIXI.Texture.from()" and "new PIXI.Texture()" in pixi.js

I am working on getting some textures assigned to an animatedSprite object in Pixi.JS

The below code works as expected:

\\ previously loaded: APP.loader.add("tile_sheet", "img/tile_spritesheet.png");

const texture_base = PIXI.BaseTexture.from(APP.loader.resources["tile_sheet"].url);
const texture_1 = new PIXI.Texture(texture_base); 
const component = PIXI.AnimatedSprite.from(texture_1);

However the following throws a "unrecognized source" error.

\\ previously loaded: APP.loader.add("tile_sheet", "img/tile_spritesheet.png");

const texture_base = PIXI.BaseTexture.from(APP.loader.resources["tile_sheet"].url);
const texture_1 = PIXI.Texture.from(texture_base); 
const component = PIXI.AnimatedSprite.from(texture_1);

My question is why does the second example [which uses PIXI.Texture.from() rather than "new PIXI.Texture()"] fail? Docs state Texture.from() should be able to accept a base texture as a source. In many of the tutorials the two syntaxes appear (confusingly) to be used interchangeably.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda